{% extends 'base.html' %}
{% load i18n %}
{% load comments %}

{% block content %}
	{{item.description|safe}}
	<p><span class="label">{% trans "Organisation:" %}</span> <a href="/data/org/{{item.organization.slug}}/">{{item.organization.name|safe}}</a></p>
	{% if item.formats %}
	<p><span class="label">{% trans "Format:" %}</span> {% for format in item.formats.all %}{% if not forloop.first %}, {% endif %} <a href="/data/format/{{format.slug}}/"{% ifequal format.is_open "Y" %} class="ok"{% else %}{% ifequal format.is_open "N" %} class="notok"{% endifequal %}{% endifequal %}>{{format.name}} ({{format.open_label}})</a>{% endfor %}<span class="outside">.</span></p>
	{% endif %}
	<p><span class="label">{% trans "License:" %}</span> <span{% if item.license.is_free %} class="free"{% endif %}>{{item.license.name}}</span></p>
	{% if item.url %}<p><span class="label">{% trans "Information page:" %}</span> <a href="{{item.url}}">{{item.name}} {% trans "information page" %}</a></p>{% endif %}
{% if item.topics %}
	<p>{% trans "Tags:" %} {% for topic in item.topics.all %}{% if not forloop.first %}<span class="outside">,</span>{% endif %} <a href="/data/topic/{{topic.slug}}/" class="button mini">{{topic.name}}</a>{% endfor %} <span class="outside">.</span></p>{% endif %}
	<hr>
	<div class="comments">	
		<h2>{% trans "Comments" %}</h2>
		<p>{% trans "What do you think about this data set?" %}</p>
			{% get_comment_list for item as comment_list %}
			{% include "comments/list.html" %}
			<hr>
			<a name="comment"></a>	
		{% include "comments/errors.html" %}
		<form action="{{ post.get_absolute_url }}#error" method="POST">
		{% include "comments/page_form.html" %}
		</form>	
	</div>
{% endblock %}

{% block sidebar %}
{% if related_items %}
	<h2>{% trans "Similar data sets" %}</h2>
	<p>{% trans "Similar data sets tagged with" %} {% for topic in item.topics.all %}{% if not forloop.first %}, {% endif %} <a href="/data/topic/{{topic.slug}}/">{{topic.name}}</a>{% endfor %}:</p>
<ul>
	{% for item in related_items %}
	<li><a href="/data/{{item.id}}/">{{item.name}}</a> från <a href="/data/org/{{item.organization.slug}}/">{{item.organization.name}}</a></li>
	{% endfor %}
</ul>
{% endif %}
{% include "helpout_snippet.html" %}
{% endblock %}
